<%
layout("/layouts/platform.html"){
%>
	<header class="header navbar bg-white shadow">
	    <div class="pull-right offscreen-right">
	         <a class="btn btn-default navbar-btn" href="${base}/platform/paysetting/add" data-toggle="modal" data-target="#addModal" ><i class="fa fa-plus"></i>&nbsp;新增</a>
		</div>
	</header>
	<div class="panel-body" style="padding-top: 70px;">
		<div class="box">
			<div class="box-body">
				<div class="col-sm-12">
					<div class="row">
				        <table class="table table-bordered table-hover mg-t datatable">
				            <thead>
				            <tr>
								<th>主体</th>
								<th>产品类型</th>
								<th>应用</th>
								<th>账户</th>
								<th>账户主体</th>
								<th>配置</th>
     	        		</table>
	    			</div>
				</div>
			</div>
		</div>
	</div>
	<!-- 新增-->
	<div id="addModal" class="modal fade bs-modal-sm"   tabindex="-3" role="dialog" aria-hidden="true">
	    <div id="addModalDialog" class="modal-dialog " >
	        <div class="modal-content">
	        
	        </div>
	    </div>
	</div>
	<script language="JavaScript">
	    var datatable;
	    function initDatatable() {
	        datatable = $('.datatable').DataTable({
	            "dom": '<"toolbar">frtip',
	            "searching": false,
	            "processing": false,
	            "serverSide": true,
	            "select": true,
	            "ordering": true,
	            "language": {
	                "url": "${base}/assets/plugins/datatables/cn.json"
	            },
	            "preDrawCallback": function () {
	                sublime.showLoadingbar($(".main-content"));
	            },
	            "drawCallback": function () {
	                sublime.closeLoadingbar($(".main-content"));
	            },
	            "ajax": {
	                "url": "${base}/platform/paysetting/data",
	                "type": "post",
	                "data": function (d) {
	                }
	            },
	            "order": [[0, "desc"]],
	            "columns": [
					{"data": "company_name", "bSortable": true},
					{"data": "product_name", "bSortable": true},
					{"data": "app_scene", "bSortable": true},
					{"data": "account_name", "bSortable": true},
					{"data": "account_company", "bSortable": true},
					{"data": "config", "bSortable": true}
	            ],
	            "columnDefs": [
	            ]
	        });
	        $("#searchBtn").on('click', function () {
	            datatable.ajax.reload();
	        });
	    }
	    $(function () {
	        initDatatable();
	        $("#addModal").on("hidden.bs.modal", function () {
	            $(this).removeData("bs.modal");
	        });
	    });
	    
	    function getAppSceneEnum(){
	    	var datas="";
	    	$.ajax({
				url : "${base}/platform/paysetting/getAppSceneEnum",
				type : "post",
				async : false,
				dataType : "json",
				success : function(data){
					datas= data;
				},
				error : function(XMLHttpRequest, textStatus, errorThrown) {
					return false;
				}
			});
	    	return datas;
	    }
	</script>

<%}%>
